package cn.skycity.framework.core.utils;

import cn.skycity.framework.core.constants.SecurityConstants;

public final class UserUtils {

    /**
     * 获取Oauth2的用户名
     * @return
     */
    public static String getUserName() {
        return ServletUtils.getRequest().getHeader(SecurityConstants.HEADER_OAUTH_USER_NAME);
    }

    public static Long getUserId() {
        return Long.parseLong(ServletUtils.getRequest().getHeader(SecurityConstants.HEADER_OAUTH_USER_ID));
    }
}
